import request from '/server/http.js'

// 添加帖子
export const addPostService = (data) => request.post('/post', data);
// 删除帖子
export const deletePostService = (postId) => request.delete(`/post/${postId}`);
// 修改帖子
export const updatePostService = (data) => request.put('/post', data);
// 获取帖子
export const getPostService = (data) => request.get('/post', data);
// 获取帖子列表
export const getPostsService = (data) => request.get('/posts', data);

// 获取帖子评论
export const getPostCommentsService = (postId, params) => request.get(`/post/comments/${postId}`, params);

// 发布评论
export const publishCommentService = (data) => request.post('/post/comment', data);